package com.zhang.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhang.mapper.IClassMapper;
import com.zhang.pojo.ClassBean;
import com.zhang.service.IClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 班级业务接口
 */
@Service
public class ClassServiceImpl implements IClassService {

    @Autowired
    private IClassMapper classMapper;

    @Override
    public PageInfo<ClassBean> findAll(int pageNo) {
        PageHelper.startPage(pageNo,5);
        return PageInfo.of(classMapper.findAll());
    }

    @Override
    public void add(ClassBean classBean) {
        classMapper.add(classBean);
    }

    @Override
    public void del(int id) {
        classMapper.del(id);
    }

    @Override
    public ClassBean findById(int id) {
        return classMapper.findById(id);
    }

    @Override
    public void update(int id, String teacher) {
        classMapper.update(id, teacher);
    }
}
